<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditOrderproductsTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditOrderproductsLabel_id}" for="id" />
                    <h:inputText id="id" value="#{orderproductsController.selected.id}" title="#{bundle.EditOrderproductsTitle_id}" required="true" requiredMessage="#{bundle.EditOrderproductsRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.EditOrderproductsLabel_price}" for="price" />
                    <h:inputText id="price" value="#{orderproductsController.selected.price}" title="#{bundle.EditOrderproductsTitle_price}" />
                    <h:outputLabel value="#{bundle.EditOrderproductsLabel_orderdate}" for="orderdate" />
                    <h:inputText id="orderdate" value="#{orderproductsController.selected.orderdate}" title="#{bundle.EditOrderproductsTitle_orderdate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditOrderproductsLabel_productid}" for="productid" />
                    <h:selectOneMenu id="productid" value="#{orderproductsController.selected.productid}" title="#{bundle.EditOrderproductsTitle_productid}" required="true" requiredMessage="#{bundle.EditOrderproductsRequiredMessage_productid}">
                        <f:selectItems value="#{productsController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditOrderproductsLabel_orderid}" for="orderid" />
                    <h:selectOneMenu id="orderid" value="#{orderproductsController.selected.orderid}" title="#{bundle.EditOrderproductsTitle_orderid}" required="true" requiredMessage="#{bundle.EditOrderproductsRequiredMessage_orderid}">
                        <f:selectItems value="#{ordersController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{orderproductsController.update}" value="#{bundle.EditOrderproductsSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditOrderproductsViewLink}"/>
                <br />
                <h:commandLink action="#{orderproductsController.prepareList}" value="#{bundle.EditOrderproductsShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditOrderproductsIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
